﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;

namespace csharpcore7_ch14_ConcurrencyAndAsynchrony
{
    class chapt14_2_10signaling
    {
        static void _Main()
        {
            var signal = new ManualResetEvent(false);

            new Thread(()=>
            {
                Console.WriteLine("Waiting for signal...");
                signal.WaitOne();
                signal.Dispose();
                Console.WriteLine("Got signal");
            }).Start();

            Thread.Sleep(2000);
            signal.Set();   //Open the signal
        }
    }
}
